<!DOCTYPE html>
<html>
<head>
    <title>用户</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="../../css/bootstrap.min.css">
    <link rel="stylesheet" href="../../css/font-awesome.min.css">
    <link rel="stylesheet" href="../../plugins/jqgrid/ui.jqgrid-bootstrap.css">
    <link rel="stylesheet" href="../../plugins/ztree/css/metroStyle/metroStyle.css">
    <link rel="stylesheet" href="../../css/main.css">
    <link rel="stylesheet" href="https://unpkg.com/element-ui@1.4.1/lib/theme-default/index.css">
    <script src="../../libs/jquery.min.js"></script>
    <script src="../../plugins/layer/layer.js"></script>
    <script src="../../libs/bootstrap.min.js"></script>
    <script src="../../libs/vue.min.js"></script>
    <script src="../../libs/utilsjs.js"></script>
    <script src="../../plugins/jqgrid/grid.locale-cn.js"></script>
    <script src="../../plugins/jqgrid/jquery.jqGrid.min.js"></script>
    <script src="../../plugins/ztree/jquery.ztree.all.min.js"></script>
    <script src="../../js/common.js"></script>
    <script src="https://unpkg.com/element-ui@1.4.1/lib/index.js "></script>

    <style>
        .avatar-uploader .el-upload {
            border: 1px dashed #d9d9d9;
            border-radius: 6px;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .avatar-uploader .el-upload:hover {
            border-color: #20a0ff;
        }

        .avatar-uploader-icon {
            font-size: 28px;
            color: #8c939d;
            width: 280px;
            height: 350px;
            line-height: 350px;
            text-align: center;
        }

        .center {
            text-align: center;
        }

        .avatar {
            width: 280px;
            height: 350px;
            display: block;
        }

        .border-line {
            padding-top: 15px;
            border-top: 1px solid #d6dcde;
            font-size: 16px;
        }

        .el-upload__input {
            display: none !important;
        }

        .small-btn {
            padding-left: 20px;
            padding-right: 20px;
            padding-top: 3px;
            padding-bottom: 3px;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.realname" placeholder="用户真实姓名">
            </div>
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.phone" placeholder="用户手机号">
            </div>

            <a class="btn btn-default" @click="query">查询</a>
            <a v-if="hasPermission('user:update')" class="btn btn-primary" @click="update"><i
                    class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            <!--<a v-if="hasPermission('user:delete')" class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>-->
            <!--<a v-if="hasPermission('user:becomeDriver')" class="btn btn-primary" @click="becomeDriver"><i class="fa fa-car"></i>&nbsp;成为司机</a>-->
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">用户名</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.username" placeholder="用户名" readonly="readonly"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">手机号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.phone" placeholder="手机号" readonly="readonly"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">密码</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.password" placeholder="密码"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">真实姓名</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.realname" placeholder="真实姓名"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">昵称</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.nickname" placeholder="昵称"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"><span style="color:red">*</span>性别</div>
                <div class="col-sm-10">
                    <label class="radio-inline"><input type="radio" v-model="user.sex" name="sex" value="1"/>男</label>
                    <label class="radio-inline"><input type="radio" v-model="user.sex" name="sex" value="0"/>女</label>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">邮箱</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.email" placeholder="邮箱"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"><span style="color:red">*</span>用户状态</div>
                <div class="col-sm-10">
                    <label class="radio-inline"><input type="radio" v-model="user.state" name="state"
                                                       value="1"/>正常</label>
                    <label class="radio-inline"><input type="radio" v-model="user.state" name="state"
                                                       value="0"/>禁用</label>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">创建时间</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.createTime" placeholder="创建时间" readonly="readonly"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">极光注册ID</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="user.registrationId" placeholder="极光注册ID"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">头像路径</div>
                <div id="appUpload" class="col-sm-10 center">
                    <el-upload id="preview" class="avatar-uploader" action="/qwj_shop/sjdriverapply/uploadCard"
                               :show-file-list="false" :on-success="handleAvatarSuccess"
                               :before-upload="beforeAvatarUpload">
                        <img v-if="imageUrl" :src="imageUrl" class="avatar">
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="../../js/modules/user/user.js?"></script>
</body>
</html>